public class State implements Comparable<State> {
	
	private String name;
	private int population, seats;
	
	public State(String name, int population) {
		this.name = name;
		this.population = population;
		addSeat();
	}
	
	public void addSeat() {
		seats++;
	}
	
	public double getPriority() {
		return population / Math.sqrt(seats * (seats + 1));
	}
	
	public String print() {
		return name + " " + seats;
	}

	@Override
	public int compareTo(State s) {
		
		if (getPriority() > s.getPriority()) return -1;
		else if (getPriority() == s.getPriority()) return 0;
		else if (getPriority() < s.getPriority()) return 1;
		return 0;
	}
}